package com.ttfeed.server.common.enums;

/**
 * @author luoxuan
 */

public enum ResultEnum {
    /**
     * 0 为请求成功 2000 - 4000前端业务逻辑错误，1000 - 2000 为后台业务逻辑错误
     */
    //请求成功
    SUCCESS(0, "请求成功"),
    FAIL(-1, "系统异常，请联系管理员"),

    /********************* 系统级异常 ***************************/
    UNAUTHENTICATED(401, "请先登录"),
    //小程序token登录需要返回401
    AUTHENTICATED_EXPIRED(401, "登录已过期，请重新登录"),
    AUTHENTICATED_EXPIRED_1(401, "您的账号已在其他地方登录，请确认账号安全"),
    //盒子没套餐权限需要返回401
    COMPANY_BOX_UNAUTHORIZED(401, "您当前没有使用盒子的权限，请联系管理员"),
    COMPANY_BOX_EXPIRED(401, "您当前使用盒子的权限已过期，如需续订，请联系管理员"),

    UNAUTHORIZED(403, "没有权限访问，请联系管理员"),
    NOT_FOUND(404, "资源路径不存在"),
    UNAUTHORIZED_DATA(403, "您无权限操作该数据"),
    LOGIN_TERMINAL_SOURCE_NOT_EXIST(405, "登录来源不存在"),
    LOGIN_TERMINAL_SOURCE_ERROR(406, "登录来源错误"),
    INTERNAL_ERROR(500, "服务器接口错误"),


    USER_MOBILE_IS_LOCKED(87, "您的手机号【%s】已被【%s】店铺禁用，请联系店铺管理员启用！"),
    USER_BOUND_WX(88, "用户已绑定微信，请解绑后重新绑定"),
    USER_UNBINDING_WX(89, "用户未绑定微信"),
    USER_UNBINDING_WX_ERROR(90, "用户解绑微信失败，必须先绑定手机号才能解绑微信"),
    USER_UNIONID_IS_NOT_UNIQUE(91, "用户微信unionId不唯一，请联系管理员处理"),
    REGISTER_SHOP_PASS_NO_UPDATE_USER_COMPANY_ID(92, "店铺审核通过，未更新管理员账号对应店铺信息"),
    PHONE_FORMAT_ERROR(93, "手机号格式有误"),
    USER_ACCOUNT_IS_NOT_UNIQUE(94, "用户账号【%s】不唯一，请联系管理员处理"),
    WX_NOT_BIND_PHONE(95, "微信登录成功，请绑定手机号"),
    PHONE_NOT_REGISTER_SHOP(96, "该手机号码没有注册商家"),
    PHONE_REGISTER_SHOP_PREPARE_AUDIT(97, "该手机号码注册商家审核中"),
    PHONE_REGISTER_SHOP_REJECTED(98, "该手机号码注册商家审核不通过"),
    COMPANY_ACCOUNT_ISLOCK(99, "店铺已被禁用"),
    USER_NOT_EXIST(100, "用户不存在，请到布搭档APP注册申请"),
    SYS_USER_NOT_EXIST(100, "用户不存在"),
    USER_PASSWORD_INCORRECT(101, "账号或密码不正确"),
    USER_ACCOUNT_ISLOCK(102, "用户账户已被禁用"),
    PHONE_CODE_NOT_EXIST(103, "手机验证码不存在"),
    USER_ACCOUNT_IS_EMPTY(104, "用户手机号为空"),
    PHONE_PASSWORD_ERROR(105, "密码不能为空"),
    PHONE_NOT_EXIST(106, "手机号码不能为空"),
    USERID_NOT_EXIST(107, "用户不能为空"),
    USER_EXIST(108, "该用户已被注册"),
    PHONE_CODE_REVALIDATE(110, "短信验证码错误或者过期"),
    DATA_VERIFICATION_NOT_PASSED(111, "业务数据验证未通过"),
    URL_NOT_FIND(112, "参数绑定错误！"),
    SERVER_TIMEOUT(113, "服务请求超时，请重试"),
    BIZ_FAIL(114, "业务异常"),
    PARAMS_NOT_NULL(115, "参数不能为空"),
    PHONE_NOT_REGISTER(116, "该手机号码没有被注册"),
    PHONE_BE_BIND(117, "该手机号码已被其他账号绑定"),
    USER_SUB_ACCOUNT_NOT_EXIST(118, "该子账号不存在"),
    USER_SUB_ACCOUNT_BE_BIND(119, "该子账号被其他账户绑定"),
    ILLEGAL_ARGS_ERR(120, "参数错误"),
    GROUP_SAVE_BATCH_ERR(121, "批量保存分组失败，分组名必须唯一"),
    PHONES_BE_BIND(122, "手机号码(%s)已被绑定"),
    COMPANY_EXIST(123, "一二批商%s已存在"),
    COMPANY_SN_EXIST(124, "一二批商编码(%s)已存在"),
    CUSTOMER_CONTACTS_ERROR(125, "客户资料联系人集合中至少并且只能有一个默认联系人"),
    SUPPLIER_EXIST(126, "一二批商名称已存在"),
    DEPARTMENT_EXIST(127, "当前机构部门名称已存在：%s"),
    USER_BRANCH_SPOT_EXIST(128, "人员账号设置机构不能重复"),
    USER_ROLES_EMPTY(129, "人员账号机构的角色权限不能为空"),
    CUSTOMER_EMPTY(130, "客户不存在"),
    STORAGE_PRODUCT_ITEM_EMPTY(131, "库存不存在"),
    CUSTOMER_ID_IS_EMPTY(132, "客户id不能为空"),
    OPERATE_TYPE_IS_EMPTY(133, "操作类型不能为空"),
    WX_BE_BIND(134, "该微信已被绑定，请勿重复绑定微信"),
    BUYER_ACCOUNT_WX_UNIONID_IS_EMPTY(135, "客户账号微信号为空"),
    COMPANY_IS_NOT_EXIST(136, "店铺不存在"),
    LOGIN_CODE_EMPTY(137, "微信code为空."),
    BIND_AND_LOGIN(138, "微信号已绑定成功，请重新登录."),
    COMPANY_USER_STATUS(139, "启用用户【%s】角色为空"),
    LOGIN_TIMES_ERROR(140, "登录过于频繁，请稍后再试"),
    REPEAT_SUBMIT(300, "重复请求，请稍后再试"),
    FILE_ID_EMPTY(301, "文件不能空."),
    LARGE_SIZE(302, "文件大小超过限制10M."),
    NETWORK_ERROR(303, "网络异常，请重新上传"),
    EXPORT_ERROR(304, "您有正在进行中的导出任务，请勿重复操作"),

    /**
     * 2xx订单异常
     */
    ORDER_GOODS_NOT_EXIST(201, "订单所选商品不存在"),
    ORDER_CUSTOMER_IS_EMPTY(202, "订单所属客户不能为空"),
    ORDER_CUSTOMER_IS_NOT_EXIST(203, "订单客户不存在"),
    ORDER_SALE_TYPE_IS_EMPTY(204, "订单货品类型不能为空"),
    ORDER_SALE_TYPE_IS_ERROR(205, "请选择正确的货品类型"),
    ORDER_GOODS_IS_EMPTY(206, "订单商品不能为空"),
    PURCHASE_IMG_IS_GT_LIMIT(207, "采购记录图片最多上传6张"),
    ORDER_REMARK_OVERFLOW(208, "备注信息不能超过100个字符"),
    BILLING_STATUS_UPDATED(209, "订单数据状态已更新,请勿重复挂单"),
    ORDER_GOODS_IS_EXPIRE(210, "商品信息已过期,请重新选择商品"),
    ORDER_GOODS_COLOR_IS_EMPTY(211, "订单商品色号不能为空"),
    DEVIATION_TYPE_IS_ERROR(212, "商品优惠类型有误"),
    DEVIATION_IS_ERROR(213, "当选择商品优惠类型时候，商品优惠必须大于0"),
    ORDER_COLOR_NOT_EXIST(214, "订单所选色号不存在"),
    COLOR_PRICE_IS_EMPTY(215, "请输入价格"),
    DYELOT_IS_TOO_LONG(216, "缸号不能超过20个字"),
    COLOR_PRICE_CANT_LT_ZERO(217, "请输入正确的价格"),
    COLOR_QUANTITY_IS_EMPTY(218, "请输入数量"),
    COLOR_QUANTITY_UNIT_IS_EMPTY(219, "数量单位不能为空"),
    COLOR_QUANTITY_CANT_LT_ZERO(220, "请输入正确的数量"),
    ORDER_CLOSE_REASON_OVERFLOW(221, "关闭原因不能超过50个字符"),
    ORDER_IS_NOT_EXIST(222, "订单信息不存在"),
    ORDER_CAN_NOT_BE_CLOSED(223, "已完成开单的订单不能关闭"),
    ORDER_IS_ALREADY_CLOSED(224, "无法操作已被关闭的订单"),
    CLOSE_ORDER_FAILED(225, "关闭订单失败"),
    ORDER_CANCEL_REASON_OVERFLOW(226, "作废原因不能超过50个字符"),
    ORDER_CAN_NOT_BE_CANCEL(227, "该订单不能被作废"),
    NO_PERM_FOR_CANCEL_ORDER(228, "没有作废订单权限"),
    CANCEL_ORDER_FAILED(229, "作废订单失败"),
    ORDER_ID_IS_EMPTY(230, "订单id不能为空"),
    ORDER_CAN_NOT_BE_DELETE(231, "该订单信息不能被删除"),
    UN_RECEIVED_BILLING_CANT_REFUND(232, "不能对没有收过款的销售单进行退款操作"),
    ORDER_CAN_NOT_PRINT_NEADEND(233, "该订单不能打印布头"),
    ORDER_SHOP_ID_IS_EMPTY(234, "订单店铺不能为空"),

    REFUND_IMG_IS_GT_LIMIT(235, "退货记录最多上传6张图片"),
    REFUND_REMARK_OVERFLOW(236, "退货备注不能超过100字"),
    REFUND_BILLING_GOODS_ID_IS_EMPTY(237, "销售单商品id不能为空"),
    REFUND_BILLING_COLOR_ID_IS_EMPTY(238, "销售单色号id不能为空"),
    REFUNDMENT_AMOUNT_IS_GT_PAYMENT_AMOUNT(239, "本次退货金额不能大于订单应收金额"),
    BILLING_CANT_RETURN_AND_REFUND(240, "非已完成状态销售单不能操作退货退款"),
    BILLING_GOODS_IS_NOT_EXIST(241, "销售单商品不存在"),
    REFUND_GOODS_COLOR_IS_EMPTY(242, "退货商品色号不能为空"),
    BILLING_COLOR_IS_NOT_EXIST(243, "销售单色号不存在"),
    REFUND_QUANTITY_IS_GT_LIMIT(244, "退货数量不能超出计价数量"),
    REFUND_USER_ID_NOT_EXIST(245, "该业务员不存在"),
    RELATE_BILLING_NOT_BELONG_CUSTOMER(246, "退货单所选关联销售单不属于该客户"),
    REFUND_GOODS_IS_EMPTY(247, "退货商品不能为空"),
    PAYMENT_AMOUNT_IS_GT_PAYABLE_AMOUNT(248, "本次收款金额不能大于订单待收金额"),
    REFUND_CUSTOMER_ID_IS_EMPTY(249, "客户id不能为空"),
    REFUND_CUSTOMER_IS_NOT_EXIST(250, "客户信息不存在"),
    REFUND_BILLING_IS_NOT_EXIST(251, "退货单信息不存在"),
    REFUND_ALREADY_RELATE_BILLING(252, "该退货单已关联销售单,请勿重复操作"),
    BILLING_IS_ALREADY_REFUND_ALL(253, "该订单已完成全部退款，不可操作"),
    BILLING_ID_IS_EMPTY(254, "单据ID不能为空"),
    BILLING_DELIVERYMAN_IS_TOO_LONG(255, "送货人不能超过20字"),
    BILLING_FOOTER_IS_TOO_LONG(256, "单据页脚不能超过100字"),
    CANCEL_REASON_IS_TO_LONG(257, "退货单作废原因不能超过50字"),
    REFUND_BILLING_IS_ALREADY_CANCELED(258, "该退货单已作废，请勿重复操作"),

    /**
     * 3xx款项异常
     */
    PAYMENT_TYPE_IS_EMPTY(301, "款项类型不能为空"),
    WX_AMOUNT_IS_ERROR(302, "微信收款金额有误"),
    ALIPAY_AMOUNT_IS_ERROR(303, "支付宝收款金额有误"),
    REMIT_AMOUNT_IS_ERROR(304, "汇款金额有误"),
    CASH_AMOUNT_IS_ERROR(305, "现金收款金额有误"),
    CARD_AMOUNT_IS_ERROR(306, "刷卡收款金额有误"),
    DISCOUNT_AMOUNT_IS_ERROR(307, "本次优惠金额有误"),
    PAYMENT_INFO_ERROR(308, "收款信息异常"),
    PAYMENT_AMOUNT_ERROR(309, "收款金额有误"),
    REMARK_IS_TOO_LONG(310, "备注信息不能超过25个字"),
    PAYABLE_AMOUNT_ERROR(311, "待收金额有误"),
    PAYMENT_IS_EMPTY(312, "收款记录不能为空"),
    TOTAL_AMOUNT_IS_ERROR(313, "收款金额必须大于0"),
    PAYMENT_METHOD_IS_EMPTY(314, "收款方式不能为空"),
    PAYMENT_METHOD_IS_ERROR(315, "收款方式有误"),
    NO_DEBT_BILLING_TO_RECEIVE(316, "暂无销售单可以操作收款"),
    PAYMENT_AMOUNT_IS_GT_DEBT_AMOUNT(317, "收款金额超出实际欠款总额, 请重新输入"),
    CUSTOMER_NO_RECEIVED_TO_REFUND(318, "该客户暂不可以操作退款"),
    REFUNDMENT_AMOUNT_IS_GT_DEBT_AMOUNT(319, "退款金额超出实际收款总额, 请重新输入"),
    REFUND_AMOUNT_IS_ERROR(320, "退货金额不能小于等于0"),
    REFUNDMENT_AMOUNT_IS_GT_RECEIVED_AMOUNT(321, "本次退款金额不能大于订单已收金额"),

    /**
     * 4xx消息推送异常
     */
    SYNC_SALE_BILLING_TO_ORDER_ERROR(420, "开单成功后发送采购商消息通知异常"),
    SYNC_SALE_BILLING_TO_PAYMENT_SNAPSHOT_ERROR(421, "开单成功创建收款记录快照消息通知异常"),
    SYNC_SALE_BILLING_TO_CUSTOMER_LEDGER_ERROR(422, "开单成功创建客户汇总开单消息通知异常"),
    SYNC_SALE_BILLING_MSG_ERROR(423, "开单成功创建开单消息通知异常"),
    SYNC_SALE_BILLING_TO_BILLING_GOODS_ERROR(424, "开单成功更新被开单商品的状态消息通知异常"),
    SYNC_CANCEL_REFUND_BILLING_TO_CUSTOMER_LEDGER_ERROR(425, "作废订单后更新客户汇总作废消息通知异常"),
    SYNC_CANCEL_BILLING_CUSTOMER_LEDGER_ERROR(426, "作废订单后款项单更新客户汇总(旧)消息通知异常"),
    SYNC_CANCEL_BILLING_PAYMENT_CUSTOMER_LEDGER_ERROR(427, "作废订单后款项单更新客户汇总消息通知异常"),
    SYNC_REFUND_BILLING_TO_CUSTOMER_LEDGER_ERROR(428, "创建退货单后更新客户汇总消息通知异常"),
    SYNC_BILLING_REFUND_TO_CUSTOMER_LEDGER_ERROR(429, "销售退货后更新客户总账消息通知异常"),
    SYNC_CANCEL_REFUND_BILLING_SALE_TO_CUSTOMER_LEDGER_ERROR(430, "作废销售退货单后更新客户汇总作废消息通知异常"),

    /**
     * 5xx微信消息推送异常
     */
    FORM_ID_IS_EMPTY(520, "要保存的formId不能为空."),
    OPENID_IS_EMPTY(521, "openId不能为空."),

    /**
     * 6xx打印相关异常
     */
    SETTING_IS_EMPTY(601, "打印设置不能为空."),
    USER_SHOP_ID_IS_EMPTY(602, "用户无店铺信息."),
    PRINT_SORTING_IS_ERROR(603, "打印排序设置有误，请重新设置排序"),
    PRINT_SORTING_IS_REPEAT(604, "打印排序属性设置重复"),
    PRINT_SORTING_IS_ERROR_WITH_SETTING(605, "打印排序和打印设置勾选项不符，请重新设置排序"),
    CURRENT_LAY_TYPE_CANT_PRINT_ENGLISH(606, "打印4列时暂不支持英文打印"),
    CURRENT_LABEL_TYPE_CANT_PRINT_ENGLISH(607, "38*30规格暂不支持英文打印"),
    LABEL_REMARK_IS_TOO_LONG1(608, "当前规格备注不能超过6个字"),
    LABEL_REMARK_IS_TOO_LONG2(609, "当前规格打印中文，备注不能超过18个字"),
    LABEL_REMARK_IS_TOO_LONG3(610, "当前规格打印英文，备注不能超过36个字"),
    PRINT_OPTIONS_IS_GT_THAN_LIMIT(611, "标签打印选项不能超过6个.(色号/备注/二维码除外)"),
    ADD_PRINT_SETTING_FAILED(612, "新增打印设置失败."),
    GOODS_ID_IS_EMPTY(613, "商品ID不能为空."),
    PRINT_TYPE_IS_EMPTY(614, "打印规格类型不能为空."),
    UPDATE_PRINT_SETTING_FAILED(615, "更新打印设置失败."),
    PRINT_TYPE_IS_ERROR(616, "打印规格类型有误."),
    PRINT_REMARK_IS_TOO_LONG(617, "打印备注不能超过45字."),
    COLOR_DETAILS_IS_EMPTY(618, "色号细码不能为空."),
    PRINT_GOODS_IS_NOT_EXIST(619, "要打印的商品不存在."),
    PRINT_COPIES_EMPTY(620, "打印份数不能小于0."),


    /**
     * 2000 - 4000前端(api)业务逻辑错误
     * 3 开头的为pc端错误码 4开头的为pda端错误码 5开头的为老板端APP错误码
     * 各模块可以单独指定 例如 30100-30199 采购模块管理模块
     */
    /**   3001  被token失效占用了，勿用  勿用  勿用 ！！！！！！！！！    **/
    REDIS_CONNECTION_FAILURE(2100, "redis 连接失败"),
    NETWORK_CONNECTIONS_ERROR(2200, "网络连接错误"),
    BUSINESS_ACCOUNT_NOT_AVAILABLE(2001, "该商家账号未激活"),
    COMPANY_UN_USE(2002, "商家已被禁用，请联系平台管理员"),
    SPOT_UN_USE(2003, "当前机构已被禁用，请联系平台管理员"),
    USE_SPOT_NOT_SWITCH(2004, "当前用户未选择机构，请先选择机构再进行操作"),
    PRINTER_IS_EMPTY(2005, "打印机未设置");

    private Integer code;
    private String message;

    ResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
